Skip to content

kata: build incrementally using crane#2383

Open
charludo wants to merge 3 commits into
mainfrom
ch/incremental-rust-electric-boogaloo
Open

kata: build incrementally using crane#2383
charludo wants to merge 3 commits into
mainfrom
ch/incremental-rust-electric-boogaloo

Conversation

@charludo
Copy link
Copy Markdown
Collaborator

  • patches are applied in a new kata.source package and consumed from there
  • changes to root Cargo.lock/Cargo.toml files require full rebuild (doesn't matter of upstream or through our patches)
  • building e.g. the agent still takes ~1:30min, because the entire agent still needs to be rebuilt and tested, but that's still significantly faster than before

@charludo charludo requested review from burgerdev and sespiros May 11, 2026 14:42
@charludo charludo added the no changelog PRs not listed in the release notes label May 11, 2026
@burgerdev
Copy link
Copy Markdown
Member

Let's fix this in #2387.

@burgerdev burgerdev closed this May 12, 2026
@burgerdev
Copy link
Copy Markdown
Member

Oh no, that was not what I meant to close!

@burgerdev burgerdev reopened this May 12, 2026
@charludo charludo force-pushed the ch/incremental-rust-electric-boogaloo branch from e7cd04e to 332a571 Compare May 13, 2026 09:59
@charludo
Copy link
Copy Markdown
Collaborator Author

Nice, this seems to fully wok now.

@charludo charludo marked this pull request as draft May 20, 2026 07:57
@charludo
Copy link
Copy Markdown
Collaborator Author

Added a second commit, making things a little more incremental. On my machine, reduces agent build times from the (already reduced) 1:22min to 0:38min (of which 22s are tests), genpolicy to 2:18min, and runtime-rs to 2:09min.

One caveat of this is that changing e.g. a runtime-rs patch still causes the next agent build to pay the full 1:22min build cost. That's because the intermediate source is different for each workspace member.

Yeah tbh I am not super happy with this step. It's a bit faster, but also less clean. I still have one more idea I'll add in a third commit, and then we'll have three choices to pick from.

@charludo
Copy link
Copy Markdown
Collaborator Author

With crane replaced by crate2nix instead:

  • agent: 1:06min
  • genpolicy: 1:51min
  • runtime-rs: 2:45min

Which means that this solution is not only much uglier and harder to maintain, it's also not straightforward to compare performance 🙂

The upside of this solution is that changing e.g. agent code, then rebuilding genpolicy immediately uses the cached output, which is nice.

I have a personal preference but am curious to see what you think. Each commit is a slightly different approach that warrants separate testing and consideration.

@charludo charludo marked this pull request as ready for review May 21, 2026 11:30
@charludo charludo force-pushed the ch/incremental-rust-electric-boogaloo branch from 0bc4b93 to 12f4847 Compare May 21, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PRs not listed in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants